﻿using System;
using System.Runtime.InteropServices;

[DllImport("kernel32.dll")]
static extern bool AllocConsole();

AllocConsole();
string title = args.Length > 0 ? args[0] : "Anonymous";
Console.Title = title; // 唯一标题格式
Console.WriteLine($"子控制台启动: {title}");

while (true)
{
    string input = Console.ReadLine();
    if (input == null) break;
    Console.WriteLine($"[{DateTime.Now.ToString("HH:mm:ss:fff")}]{input}");
}

